/** @namespace app.model.DailyCategoryData */
module.exports = app => {
  const {STRING, INTEGER, TINYINT, DATEONLY} = app.Sequelize;

  return app.model.define('daily_category_data',
      {
        rank: {type: TINYINT(2).UNSIGNED, allowNull: false, defaultValue: 0},
        active: {type: INTEGER.UNSIGNED, allowNull: false, defaultValue: 0},
        _new: {type: INTEGER.UNSIGNED, allowNull: false, defaultValue: 0},
        open: {type: INTEGER.UNSIGNED, allowNull: false, defaultValue: 0},
        gift: {type: STRING, allowNull: false, defaultValue: 0},
        watch: {type: INTEGER.UNSIGNED, allowNull: false, defaultValue: 0},
        created_at: {type: DATEONLY, unique: 'p_c_date'},
        daily_platform_category_id: {
          type: INTEGER.UNSIGNED,
          unique: 'p_c_date',
        },
      },
      {updatedAt: false},
  );
};